<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the Joomla modellist library
jimport('joomla.application.component.modellist');
/**
 * CategoryList Model
 */
class ShopModelShop extends JModelList
{
	function getCategory()
	{
		$db =& JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select('id,title');
		$query->from('#__shop_category');
		$query->order('id desc');
		$db->setQuery((string)$query);
		return $db->loadObjectList();
	}
	
	function getProducts()
	{
		$db =& JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select('id,title,image');
		$query->from('#__shop_product');
		$query->order('id desc');
		$db->setQuery((string)$query,0,15);
		return $db->loadObjectList();
	}
	function getOrders()
	{
		$db =& JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select('*');
		$query->from('#__shop_order');
		$query->order('id desc');
		$db->setQuery((string)$query,0,15);
		return $db->loadObjectList();
	}

}